import React from 'react';

class ProfilePage extends React.Component {

  state={
    count: 0
  }

  componentDidMount() {
    setInterval(() => {
      // 组件挂载时开启定时器，一秒加一
      this.setState({
        count: this.state.count + 1
      })
    },1000)
  }

  render() {
    return <div>{this.state.count}</div>;
  }
}

export default ProfilePage;
